package fr.uniscol.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Enseignant implements IUniscolUser, Serializable {

	private BaseAnneeScolaire base = null;
	
	private long id = 0;
	
	private String nom = null;
	
	private String prenom = null;
	
	private String idSiecle = null;
	
	private List<ServiceEnseignant> services = null;
	
	private String login = null;
	
	private String password = null;

	public BaseAnneeScolaire getBase() {
		return base;
	}

	public void setBase(BaseAnneeScolaire base) {
		this.base = base;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public String getPrenom() {
		return prenom;
	}

	public void setPrenom(String prenom) {
		this.prenom = prenom;
	}

	public String getIdSiecle() {
		return idSiecle;
	}

	public void setIdSiecle(String idSiecle) {
		this.idSiecle = idSiecle;
	}

	public List<ServiceEnseignant> getServices() {
		if(services == null){
			services = new ArrayList<ServiceEnseignant>();
		}
		return services;
	}

	public void setServices(List<ServiceEnseignant> services) {
		this.services = services;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Override
	public String getLogin() {
		return this.login;
	}

	@Override
	public String getPassword() {
		return this.password;
	}

	@Override
	public String getIdentite() {
		String identite = getPrenom() + " " + getNom();
		if(getBase().getEtablissement() != null){
			identite += "(" + getBase().getEtablissement().getNom() + ")";
		}
		return identite;
	}

	@Override
	public EtablissementModel getEtablissement() {
		return getBase().getEtablissement();
	}

	@Override
	public BaseAnneeScolaire getBaseSelectionnee() {
		return getBase();
	}

	@Override
	public void setBaseSelectionnee(BaseAnneeScolaire base) {
		setBase(base);
	}


	@Override
	public void setIdentite(String identite) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean isAuthentifie() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void setAuthentifie(boolean authentifie) {
		// TODO Auto-generated method stub
		
	}

    @Override
    public boolean isSuperAdmin() {
        return false;
    }
}
